<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../Jquery%20test/jquery.js"></script>
    <script>
        $(function () {
            $("#get").click(function () {
                $.get("http://47.107.100.125:8080/api/home/getAgreement",function(data,status){
                    alert("数据: " + data + "\n状态: " + status);
                });
            })
            $(".post").click(function () {
                $ .post("http://47.107.100.125:8080/api/home/getAgreement",function(data,status){
                    alert("数据: " + data + "\n状态: " + status);
                });
            })
            $(".ajax").click(function () {
              // $ .ajax({
                //     url:"http://47.107.100.125:8080/api/home/getAgreement",
                //     success:function (data) {
                //         console.log(data)
                //     }
                $ .ajax({
                    url:"http://47.107.100.125:8080/api/home/getAgreement",
                    success:function (data) {
                        console.log(data)
                    },
                    error:function () {
                        console.log("失败了！")
                    }
                });
                $(document).ajaxStart(function () {
                    $(".mask").show(1000)
                })
                $(document).ajaxComplete(function () {
                    $(".mask").hide(1000)
                })
            })

              })


    </script>
</head>
<body>
<h2>JQuery的Ajax</h2>
<input type="button" class="get"  value="get请求"/>
<input type="button" class="post"  value="post请求"/>
<input type="button" class="ajax"  value="ajax请求"/>
</body>
</html>